#ifndef HBR_H_
#define HBR_H_

#include "recbase.h"
#include "rectype.h"
#include "stdffield.h"
#include <string>

namespace opsrc {
    namespace stdf {

        class Hbr : public RecBase
        {
        public:
            Hbr(stdf_rec stdfrec,  int reclen, std::ios::pos_type fileRecFirstBytePosition, int orderindex,  endian e, char* buf);
            virtual ~Hbr();

            const StdfField<int> getHeadNum() const;
            void setHeadNum(StdfField<int> headnum);

            const StdfField<int> getSiteNum() const;
            void setSiteNum(StdfField<int> sitenum);

            const StdfField<int> getHbinNum() const;
            void setHbinNum(StdfField<int> hbinnum);

            const StdfField<long> getHbinCount() const;
            void setHbinCount(StdfField<long> hbincnt);

            const StdfField<string> getHbinPassFail() const;
            void setHbinPassFail(StdfField<string> hbinpf);

            const StdfField<string> getHbinName() const;
            void setHbinName(StdfField<string> hbinnam);
            void readFields(char *buf);

        protected:
            Hbr();

        private:
            StdfField<int> head_num;		// 1u
            StdfField<int> site_num;		// 1u
            StdfField<int> hbin_num;		// 2u
            StdfField<long> hbin_cnt;		// u4
            StdfField<string> hbin_pf;		// c1
            StdfField<string> hbin_nam;		// cn

            endian en;
            bool decodeFields;


            /* HEAD_NUM U*1 Test head number See note
SITE_NUM U*1 Test site number
HBIN_NUM U*2 Hardware bin number
HBIN_CNT U*4 Number of parts in bin
HBIN_PF C*1 Pass/fail indication space
HBIN_NAM C*n Name of hardware bin length byte = 0			*/

        };

    }	// namespace stdf
}		// namespace opsrc

#endif /*HBR_H_*/
